﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Models;

public partial class Admin_shop_User_Detail : AdminBase
{
    public string  result, result1, sum1, sum2, sum3, myUname;

    public int spid = 0;

    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        if (!string.IsNullOrEmpty(Request.Params["SPID"]))
        {
            spid = int.Parse(HttpContext.Current.Request.QueryString["SPID"].ToString());
        }
        if (!IsPostBack)
        {
            grbind();
        }
    }

    private void grbind()
    {

        Entities MyDB = new Entities();



        var _order = MyDB.Y_Order.Where(x => x.SPID == spid && x.UparentId == "8888").OrderByDescending(x => x.OCreatTime);

        this.Repeater3.DataSource = _order.ToList();//已发货（待收货）
        this.Repeater3.DataBind();


        var sorder = MyDB.S_Order.Where(x => x.SPID == spid ).OrderByDescending(x => x.OCreatTime);//全部
        this.Repeater4.DataSource = sorder.ToList();//2待收货
        this.Repeater4.DataBind();



    }



    public string getPayState(string OPayState)
    {
        string Result = "";
        int state = int.Parse(OPayState);
        if (state == 1)
        {
            Result = "<div style=\"padding:1px 1px;font-size:12px;line-height:1.5;border-radius: 3px;color: #23c6c8;text-align:center;\">已支付</div>";
        }
        else
        {
            Result = "<div style=\"padding: 1px 1px;font-size:12px;line-height:1.5;border-radius: 3px;color:#ed5565;text-align:center;\">未支付</div>";
        }
        return Result;
    }
    public string getFahuoState(string OState)
    {
        string Result = "";
        int state = int.Parse(OState);
        switch (state)
        {
            case 0: Result = "<div style=\"padding: 1px 1px;font-size:12px;line-height:1.5;border - radius: 3px;background-color:#333;; border-color:##ed5565;;color:#FFFFFF;text-align:center;\">待支付</div>"; break;
            case 1: Result = "<div style=\"padding: 1px 1px;font-size:12px;line-height:1.5;border - radius: 3px;background-color:#ed5565;; border-color:##ed5565;;color:#FFFFFF;text-align:center;\">待发货</div>"; break;
            case 2: Result = "<div style=\"padding:1px 1px;font-size:12px;line-height:1.5;border - radius: 3px;background-color: #23c6c8; border - color: #23c6c8;color: #FFFFFF;text-align:center;\">已发货</div>"; break;
            case 3: Result = "<div style=\"padding:1px 1px;font-size:12px;line-height:1.5;border - radius: 3px;background-color: #23c6c8; border - color: #23c6c8;color: #FFFFFF;text-align:center;\">已验收</div>"; break;
            case 4: Result = "<div style=\"padding:1px 1px;font-size:12px;line-height:1.5;border - radius: 3px;background-color: #23c6c8; border - color: #23c6c8;color: #FFFFFF;text-align:center;\">已评价</div>"; break;
        }
        return Result;
    }



}